/*
 * @Description:
 * @Version: 1.0.0
 * @Author: gyh
 * @Date: 2021-08-17 22:33:44
 * @LastEditors: gyh
 * @LastEditTime: 2021-08-17 22:35:53
 */
import {
  ElAlert,
  ElButton,
  ElCard,
  ElCarousel,
  ElCarouselItem,
  ElCascader,
  ElInfiniteScroll,
  ElLoading,
  ElMessage,
  ElMessageBox,
  ElNotification,
} from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'

const components = [ElAlert, ElButton, ElCard, ElCarousel, ElCarouselItem, ElCascader]

const plugins = [ElInfiniteScroll, ElLoading, ElMessage, ElMessageBox, ElNotification]

export const useElement = (app: any) => {
  components.forEach(component => {
    app.component(component.name, component)
  })
  plugins.forEach(plugin => {
    app.use(plugin)
  })
}
